/*
 *
 *  Copyright (C) 2007-2020 SimplyCore, LLC
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 *
 */

#include "usbd.h"
#include <linux/ctype.h> 
#define IllIIlIl (0x2ea+3793-0x10bb)
static struct cdev*lllllll=NULL;static dev_t lIllIll=MKDEV((0x105b+2222-0x1909),
(0x3a3+3057-0xf94));static void*IlIlllll[IllIIlIl]={(0x2f4+8063-0x2273)};static 
struct mutex llIllIl;static struct class*lIIIllI=NULL;ssize_t llIlIIlll(struct 
file*,char __user*,size_t,loff_t*);ssize_t lIIIIlIII(struct file*,const char 
__user*,size_t,loff_t*);long IIIlIlllI(struct file*,unsigned int,unsigned long);
#ifdef CONFIG_COMPAT
long lIlIllIll(struct file*,unsigned int,unsigned long);
#endif
int lIllIllll(struct inode*,struct file*);int lllIllIIl(struct inode*,struct 
file*);unsigned int lIlllIIll(struct file*lIlllI,poll_table*lIIllI);int 
IIllIIIlI(struct file*lIlllI,struct vm_area_struct*IlllIll);
#if KERNEL_LT_EQ((0xda3+4389-0x1ec6),(0xd48+2065-0x1553),(0xba9+4284-0x1c4e)) 
static int lIIllIII(struct class_device*dev,char**envp,int lIIllIIIl,char*llIIl,
int llIllllIl);static void lIIIlIIl(struct class_device*device);
#elif KERNEL_LT_EQ((0x14ef+3744-0x238d),(0x1739+2269-0x2010),(0x8e0+7655-0x26ae)\
) 
static int lIIllIII(struct class_device*dev,struct kobj_uevent_env*IlIIlll);
static void lIIIlIIl(struct class_device*device);
#else 
static int lIIllIII(struct device*dev,struct kobj_uevent_env*IlIIlll);
#endif
static struct file_operations lIIlIIlll={.owner=THIS_MODULE,.read=llIlIIlll,.
write=lIIIIlIII,.poll=lIlllIIll,.unlocked_ioctl=IIIlIlllI,
#ifdef CONFIG_COMPAT
.compat_ioctl=lIlIllIll,
#endif
.mmap=IIllIIIlI,.open=lIllIllll,.release=lllIllIIl,};int llIIIIlII(void){int 
IlIlI=(0xa2d+4319-0x1b0c);IlllI(
"\x69\x6e\x69\x74\x5f\x63\x64\x65\x76\x5f\x6d\x6f\x64\x75\x6c\x65\x3a\x20\x2b\x2b" "\n"
);do{mutex_init(&llIllIl);lIIIllI=class_create(THIS_MODULE,lIlllll);if(lIIIllI==
NULL){IlllI(
"\x69\x6e\x69\x74\x5f\x63\x64\x65\x76\x5f\x6d\x6f\x64\x75\x6c\x65\x3a\x20\x63\x6c\x61\x73\x73\x5f\x63\x72\x65\x61\x74\x65\x20\x66\x61\x69\x6c\x65\x64\x2e" "\n"
);IlIlI=-ENOMEM;break;}
#if KERNEL_LT_EQ((0xba+3828-0xfac),(0x29a+5894-0x199a),(0x1a26+1343-0x1f56)) 
lIIIllI->hotplug=lIIllIII,lIIIllI->release=lIIIlIIl,
#elif KERNEL_LT_EQ((0x1d8c+357-0x1eef),(0x82d+3785-0x16f0),(0x1aa2+121-0x1b02)) 
lIIIllI->uevent=lIIllIII,lIIIllI->release=lIIIlIIl,
#else 
lIIIllI->dev_uevent=lIIllIII,
#endif
IlIlI=alloc_chrdev_region(&lIllIll,(0x173d+3332-0x2441),IllIIlIl,lIlllll);if(
IlIlI!=(0x1bb2+805-0x1ed7)){IlllI(
"\x69\x6e\x69\x74\x5f\x63\x64\x65\x76\x5f\x6d\x6f\x64\x75\x6c\x65\x3a\x20\x61\x6c\x6c\x6f\x63\x5f\x63\x68\x72\x64\x65\x76\x5f\x72\x65\x67\x69\x6f\x6e\x20\x66\x61\x69\x6c\x65\x64\x2e\x20\x45\x72\x72\x6f\x72\x20\x6e\x75\x6d\x62\x65\x72\x20\x25\x64" "\n"
,IlIlI);break;}IlllI(
"\x69\x6e\x69\x74\x5f\x63\x64\x65\x76\x5f\x6d\x6f\x64\x75\x6c\x65\x3a\x20\x61\x6c\x6c\x6f\x63\x61\x74\x65\x64\x20\x64\x65\x76\x6e\x75\x6d\x20\x72\x65\x67\x69\x6f\x6e\x3a\x20\x4d\x61\x6a\x6f\x72\x20\x25\x64\x20\x4d\x69\x6e\x6f\x72\x20\x25\x64" "\n"
,MAJOR(lIllIll),MINOR(lIllIll));memset(IlIlllll,(0x12b8+46-0x12e6),sizeof(
IlIlllll));lllllll=cdev_alloc();if(lllllll==NULL){IlllI(
"\x69\x6e\x69\x74\x5f\x63\x64\x65\x76\x5f\x6d\x6f\x64\x75\x6c\x65\x3a\x20\x63\x64\x65\x76\x5f\x61\x6c\x6c\x6f\x63\x20\x66\x61\x69\x6c\x65\x64\x2e" "\n"
);IlIlI=-ENOMEM;break;}lllllll->owner=THIS_MODULE;lllllll->ops=&lIIlIIlll;IlIlI=
cdev_add(lllllll,lIllIll,IllIIlIl);if(IlIlI!=(0x3e4+2959-0xf73)){IlllI(
"\x69\x6e\x69\x74\x5f\x63\x64\x65\x76\x5f\x6d\x6f\x64\x75\x6c\x65\x3a\x20\x63\x64\x65\x76\x5f\x61\x64\x64\x20\x66\x61\x69\x6c\x65\x64\x2e\x20\x45\x72\x72\x6f\x72\x20\x6e\x75\x6d\x62\x65\x72\x20\x25\x64" "\n"
,IlIlI);break;}}while((0x11cb+1523-0x17be));if(IlIlI!=(0x587+4633-0x17a0)){if(
lllllll){cdev_del(lllllll);}if(lIllIll!=MKDEV((0x4b8+7704-0x22d0),
(0x168a+2440-0x2012))){unregister_chrdev_region(lIllIll,(0x179+1584-0x6aa));}if(
lIIIllI){class_destroy(lIIIllI);}lllllll=NULL;lIllIll=MKDEV((0x1393+3507-0x2146)
,(0xa8c+643-0xd0f));lIIIllI=NULL;}IlllI(
"\x69\x6e\x69\x74\x5f\x63\x64\x65\x76\x5f\x6d\x6f\x64\x75\x6c\x65\x3a\x20\x2d\x2d\x20\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
,IlIlI);return IlIlI;}int lIllIIII(void){IlllI(
"\x64\x65\x73\x74\x72\x6f\x79\x5f\x63\x64\x65\x76" "\n");if(lllllll){cdev_del(
lllllll);}if(lIllIll!=MKDEV((0x135d+224-0x143d),(0x12a7+5044-0x265b))){
unregister_chrdev_region(lIllIll,IllIIlIl);}if(lIIIllI){class_destroy(lIIIllI);}
lllllll=NULL;lIllIll=MKDEV((0x357+4480-0x14d7),(0x418+5335-0x18ef));lIIIllI=NULL
;return(0x96+8976-0x23a6);}
#if KERNEL_LT_EQ((0x87b+5641-0x1e82),(0x7f5+1467-0xdaa),(0xeb0+2924-0x1a03)) 
static void lIIIlIIl(struct class_device*device){kfree(device);}
#endif
#if KERNEL_LT_EQ((0x1308+4845-0x25f3),(0x23b+387-0x3b8),(0x29f+6146-0x1a8a)) 
static int lIIllIII(struct class_device*device,char**envp,int lIIllIIIl,char*
llIIl,int llIllllIl){struct IIIlll*lllll=device->class_data;if(lllll&&lllll->
IIllllIl){int i;int length;struct IIIllllI*llIIlII;for(llIIlII=lllll->IIllllIl,i
=(0x773+2945-0x12f4),length=(0x18b3+3025-0x2484);llIIlII->name&&(llIIlII->
IlllIIII||llIIlII->lllIIIIl);llIIlII++){const char*IlllIIII=llIIlII->lllIIIIl?
llIIlII->lllIIIIl(lllll->context):llIIlII->IlllIIII;
#if KERNEL_LT_EQ((0x506+6328-0x1dbc),(0x83+1487-0x64c),(0x152a+2029-0x1d08)) 
if(add_hotplug_env_var(
#else 
if(add_uevent_var(
#endif
envp,lIIllIIIl,&i,llIIl,llIllllIl,&length,"\x25\x73\x5f\x25\x73\x3d\x25\x73",
lIlllll,llIIlII->name,IlllIIII)==(0x5d0+167-0x677)){int IIIIIl;for(IIIIIl=
(0x14fc+3818-0x23e6);envp[i-(0x4fd+6989-0x2049)][IIIIIl]!='\0'&&envp[i-
(0xfe6+4645-0x220a)][IIIIIl]!=((char)(0x198a+3018-0x2517));IIIIIl++)envp[i-
(0x353+1465-0x90b)][IIIIIl]=toupper(envp[i-(0x595+3226-0x122e)][IIIIIl]);}}}
return(0x11d4+3102-0x1df2);}
#else 
static int lIIllIII(
#if KERNEL_LT_EQ((0x49+2018-0x829),(0xec+2319-0x9f5),(0x95f+4158-0x1984)) 
struct class_device*device,
#else 
struct device*device,
#endif
struct kobj_uevent_env*IlIIlll){
#if KERNEL_LT_EQ((0x184f+257-0x194e),(0x9ba+2799-0x14a3),(0x42a+6979-0x1f54)) 
struct IIIlll*lllll=device->class_data;
#else 
struct IIIlll*lllll=dev_get_drvdata(device);
#endif
if(lllll&&lllll->IIllllIl){struct IIIllllI*llIIlII;for(llIIlII=lllll->IIllllIl;
llIIlII->name&&(llIIlII->IlllIIII||llIIlII->lllIIIIl);llIIlII++){const char*
IlllIIII=llIIlII->lllIIIIl?llIIlII->lllIIIIl(lllll->context):llIIlII->IlllIIII;
if(add_uevent_var(IlIIlll,"\x25\x73\x5f\x25\x73\x3d\x25\x73",lIlllll,llIIlII->
name,IlllIIII)==(0xeda+1140-0x134e)){int IIIIIl;for(IIIIIl=(0x88d+4970-0x1bf7);
IlIIlll->envp[IlIIlll->envp_idx-(0x6d7+3029-0x12ab)][IIIIIl]!='\0'&&IlIIlll->
envp[IlIIlll->envp_idx-(0x110d+2997-0x1cc1)][IIIIIl]!=
((char)(0xc29+1760-0x12cc));IIIIIl++)IlIIlll->envp[IlIIlll->envp_idx-
(0x70d+2587-0x1127)][IIIIIl]=toupper(IlIIlll->envp[IlIIlll->envp_idx-
(0x1caf+2281-0x2597)][IIIIIl]);}}}return(0xf93+555-0x11be);}
#endif 
int IllIlIlII(struct IIIlll*lllll,int IIllll){















#if KERNEL_GT_EQ((0x18c9+3248-0x2577),(0x108a+399-0x1213),(0x375+5270-0x17f0)) 
struct device*dev=NULL;dev=device_create(lIIIllI,NULL,MKDEV(MAJOR(lIllIll),MINOR
(lIllIll)+IIllll),lllll,lIlllll"\x5f\x25\x64",IIllll);
#elif KERNEL_EQ((0x812+2631-0x1257),(0x1875+878-0x1bdd),(0x5c4+1885-0xd07)) 
struct device*dev=NULL;dev=device_create_drvdata(lIIIllI,NULL,MKDEV(MAJOR(
lIllIll),MINOR(lIllIll)+IIllll),lllll,lIlllll"\x5f\x25\x64",IIllll);
#else 
struct class_device*dev=NULL;int llIIlIIII;dev=kzalloc(sizeof(*dev),GFP_KERNEL);
if(dev){dev->devt=MKDEV(MAJOR(lIllIll),MINOR(lIllIll)+IIllll);dev->dev=NULL;dev
->class=lIIIllI;dev->parent=NULL;dev->release=NULL;
dev->class_data=lllll;
#if KERNEL_LT_EQ((0x23+5936-0x1751),(0x1318+2452-0x1ca6),(0xf0c+3328-0x1bfd)) 
dev->hotplug=NULL;
#else 
dev->uevent=NULL;
#endif
snprintf(dev->class_id,BUS_ID_SIZE,lIlllll"\x5f\x25\x64",IIllll);llIIlIIII=
class_device_register(dev);if(llIIlIIII){kfree(dev);dev=ERR_PTR(llIIlIIII);}}
else{dev=ERR_PTR(-ENOMEM);}
#endif
if(IS_ERR(dev)){return PTR_ERR(dev);}lllll->dev=dev;return(0x1914+1696-0x1fb4);}
void lllIlIIlI(struct IIIlll*lllll,int IIllll){if(lllll->dev){
#if KERNEL_GT_EQ((0x1db6+490-0x1f9e),(0x715+988-0xaeb),(0x2ad+8010-0x21dd)) 
device_destroy(lIIIllI,MKDEV(MAJOR(lIllIll),MINOR(lIllIll)+IIllll));
#else 
class_device_destroy(lIIIllI,MKDEV(MAJOR(lIllIll),MINOR(lIllIll)+IIllll));
#endif
lllll->dev=NULL;}}int IllllIlI(struct IIIlll*lllll,int IlIlllII,int llIIlIII){
int i;if(llIIlIII==-(0x9a5+6396-0x22a0)){llIIlIII=IllIIlIl-(0xca9+507-0xea3);}if
(IlIlllII<(0x203d+1745-0x270e)||IlIlllII>=IllIIlIl){return-EINVAL;}if(llIIlIII<
(0x5d9+6130-0x1dcb)||llIIlIII>=IllIIlIl){return-EINVAL;}if(IlIlllII>llIIlIII){
return-EINVAL;}mutex_lock(&llIllIl);for(i=IlIlllII;i<=llIIlIII;i++){if(IlIlllll[
i]==NULL){if(IllIlIlII(lllll,i)==(0x2182+805-0x24a7)){lllll->IIllll=i;IlIlllll[i
]=lllll;if(lllll->ops.IlIIlIll){lllll->ops.IlIIlIll(lllll->context);}break;}}}
mutex_unlock(&llIllIl);if(i>llIIlIII){return-EOVERFLOW;}return
(0x5c8+7317-0x225d);}dev_t IllIIIlIl(struct IIIlll*lllll){dev_t IlIlI=MKDEV(
(0x113+6967-0x1c4a),(0x94a+6181-0x216f));mutex_lock(&llIllIl);if(lllll->IIllll>=
(0x102a+5138-0x243c)&&lllll->IIllll<IllIIlIl){IlIlI=MKDEV(MAJOR(lIllIll),MINOR(
lIllIll)+lllll->IIllll);}mutex_unlock(&llIllIl);return IlIlI;}int IIIIllII(
struct IIIlll*lllll){int IIllll;mutex_lock(&llIllIl);IIllll=lllll->IIllll;
mutex_unlock(&llIllIl);return IIllll;}void lllIllII(struct IIIlll*lllll){
mutex_lock(&llIllIl);if(lllll->IIllll>=(0x21e2+444-0x239e)&&lllll->IIllll<
IllIIlIl&&IlIlllll[lllll->IIllll]==lllll){IlIlllll[lllll->IIllll]=NULL;lllIlIIlI
(lllll,lllll->IIllll);}lllll->IIllll=-(0x782+3304-0x1469);mutex_unlock(&llIllIl)
;if(lllll->ops.llIIllll){lllll->ops.llIIllll(lllll->context);}}void IllIIllII(
struct IIIlll*lllll){
#if KERNEL_LT_EQ((0x12e8+1642-0x1950),(0x1743+1984-0x1efd),(0x466+4110-0x1465))
kobject_hotplug(&lllll->dev->kobj,KOBJ_ONLINE);
#else
kobject_uevent(&lllll->dev->kobj,KOBJ_ONLINE);
#endif
}void lllIIlllI(struct IIIlll*lllll){
#if KERNEL_LT_EQ((0x13c5+1262-0x18b1),(0x63+1636-0x6c1),(0xef1+5662-0x2500))
kobject_hotplug(&lllll->dev->kobj,KOBJ_OFFLINE);
#else
kobject_uevent(&lllll->dev->kobj,KOBJ_OFFLINE);
#endif
}
ssize_t llIlIIlll(struct file*lIlllI,char __user*IlllIlIII,size_t llIlI,loff_t*
llIllIIlI){struct IIIlll*lllll=lIlllI->private_data;if(lllll){if(lllll->ops.read
){return lllll->ops.read(lllll->context,IlllIlIII,llIlI);}else{return
(0x1c9f+1046-0x20b5);}}return-ENODEV;}ssize_t lIIIIlIII(struct file*lIlllI,const
 char __user*IlllIlIII,size_t llIlI,loff_t*llIllIIlI){struct IIIlll*lllll=lIlllI
->private_data;if(lllll){if(lllll->ops.write){return lllll->ops.write(lllll->
context,IlllIlIII,llIlI);}else{return(0x1f91+911-0x2320);}}return-ENODEV;}
unsigned int lIlllIIll(struct file*lIlllI,poll_table*lIIllI){struct IIIlll*lllll
=lIlllI->private_data;if(lllll){if(lllll->ops.poll){return lllll->ops.poll(lllll
->context,lIlllI,lIIllI);}else{return(0x12ad+3775-0x216c);}}return-ENODEV;}long 
IIIlIlllI(struct file*lIlllI,unsigned int lIIIIl,unsigned long IlIIII){struct 
IIIlll*lllll=lIlllI->private_data;if(lllll){if(lllll->ops.unlocked_ioctl){return
 lllll->ops.unlocked_ioctl(lllll->context,lIIIIl,IlIIII);}else{return
(0x1c56+273-0x1d67);}}return-ENODEV;}
#ifdef CONFIG_COMPAT
long lIlIllIll(struct file*lIlllI,unsigned int lIIIIl,unsigned long IlIIII){
struct IIIlll*lllll=lIlllI->private_data;if(lllll){if(lllll->ops.compat_ioctl){
return lllll->ops.compat_ioctl(lllll->context,lIIIIl,IlIIII);}else{return
(0xcda+931-0x107d);}}return-ENODEV;}
#endif
int IIllIIIlI(struct file*lIlllI,struct vm_area_struct*IlllIll){struct IIIlll*
lllll=lIlllI->private_data;if(lllll){if(lllll->ops.mmap){return lllll->ops.mmap(
lllll->context,IlllIll);}else{return-EINVAL;}}return-ENODEV;}int lIllIllll(
struct inode*inode,struct file*lIlllI){int IlIlI=-ENODEV;u32 m=iminor(inode);
struct IIIlll*lllll;mutex_lock(&llIllIl);lllll=IlIlllll[m];if(lllll&&lllll->ops.
IlIIlIll){lllll->ops.IlIIlIll(lllll->context);}mutex_unlock(&llIllIl);if(lllll){
lIlllI->private_data=lllll;





mutex_lock(&lllll->mutex);if(lllll->ops.open){IlIlI=lllll->ops.open(lllll->
context,++lllll->IIlllII);}else{IlIlI=(0x1eca+1320-0x23f2);}mutex_unlock(&lllll
->mutex);}return IlIlI;}int lllIllIIl(struct inode*inode,struct file*lIlllI){int
 IlIlI=-ENODEV;struct IIIlll*lllll=lIlllI->private_data;if(lllll){





mutex_lock(&lllll->mutex);if(lllll->ops.release){IlIlI=lllll->ops.release(lllll
->context,--lllll->IIlllII);}else{IlIlI=(0x1ad6+1437-0x2073);}mutex_unlock(&
lllll->mutex);if(lllll->ops.llIIllll){lllll->ops.llIIllll(lllll->context);}}
return IlIlI;}
